<!DOCTYPE html>
<html>
	<head>
		<title>use js to create element</title>
		<script type="text/javascript" src="jquery-2.1.3.min.js"></script>
	</head>
	<body>
		<h1>Use js to create select options</h1>
		<div id="div_main">
			<select id="slt_node_vals">
				<script type="text/javascript">
				var i = 0;
				for(var x in NodeFilter){
					if(x.match(/^SHOW/)){
						var val = NodeFilter[x];
						//<option value="opt_1">opt A</option>
						document.writeln("<option value='opt_"+ val +"'>"+x+" (0x"+val.toString(16).toUpperCase()+")"+"</option>");
					}
				}
				</script>
			</select>
		</div>
	</body>
</html>